package com.retail.task;

import com.retail.core.task.RetailQuartzJobBean;
import com.retail.shop.service.ShopCardLogService;
import com.retail.system.service.CronTriggersService;
import com.retail.system.service.CronTriggersSynchroTimeService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 分销等级配置
 *
 * @author Administrator
 */
@Component
@Slf4j
public class ShopCardJobTask extends RetailQuartzJobBean {
    @Autowired
    private CronTriggersService cronTriggersService;

    @Autowired
    private ShopCardLogService shopCardLogService;

    @Autowired
    private CronTriggersSynchroTimeService cronTriggersSynchroTimeService;

    @Override
    protected CronTriggersService getCronTriggersService() {
        return cronTriggersService;
    }

    @Override
    protected CronTriggersSynchroTimeService getcronTriggersSynchroTimeService() {
        return cronTriggersSynchroTimeService;
    }

    @Override
    public void task(JobExecutionContext jobExecutionContext) {
        // 更新系统所有过期卡项
        shopCardLogService.updateShopCard();
    }
}
